package com.senjoeson.abilityservice.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import com.senjoeson.abilityservice.bean.PanelItemData;
import com.senjoeson.abilityservice.R;

import org.jetbrains.annotations.NotNull;

/**
 * @USER senjoeson
 * @DATE 2021/1/30 6:29 下午
 * @Desc
 **/
public class PanelItemAdapter extends BaseQuickAdapter<PanelItemData, BaseViewHolder> {
    public PanelItemAdapter() {
        super(R.layout.panel_control_view_item);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, PanelItemData panelItemData) {
        holder.setText(R.id.function, panelItemData.getFunctionName());
        holder.getView(R.id.function).setOnClickListener(v -> panelItemData.getItemClick().invoke());
    }
}
